<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:a4j="http://richfaces.org/a4j">
  
<h:body>
<h1>search/modification flight </h1>

<h:form>
		<p:panel header="Find By Airport">
			<h:panelGrid columns="3" id="regGrid">
				<h:outputLabel for="airport">insert the airport that you want to see all availables flight:</h:outputLabel>
				<p:inputText id="airport" value="#{FlightBean.name3}" />
				<p:message for="airport" />
			</h:panelGrid>
				<p:commandButton value="Search!!" update="regGrid"
				action="#{FlightBean.searchByAirport()}" />
		</p:panel>
</h:form>

<h:dataTable value="#{FlightBean.ff3}" var="item">
    		<h:column>#{item}</h:column>
		</h:dataTable>


<h:form>
		<p:panel header="Find By Arrival">
			<h:panelGrid columns="3" id="regGrid">
				<h:outputLabel for="city">insert the city that you want to see all availables flight:</h:outputLabel>
				<p:inputText id="city" value="#{FlightBean.name}" />
				<p:message for="city" />
			</h:panelGrid>
				<p:commandButton value="Search!!" update="regGrid"
				action="#{FlightBean.searchByArrival()}" />
		</p:panel>
</h:form>

<h:dataTable value="#{FlightBean.ff}" var="item">
    		<h:column>#{item}</h:column>
		</h:dataTable>

<h:form>
		<p:panel header="Find By departure">
			<h:panelGrid columns="3" id="regGrid">
				<h:outputLabel for="city">insert the city that you want to see all availables flight:</h:outputLabel>
				<p:inputText id="city" value="#{FlightBean.name2}" />
				<p:message for="city" />
			</h:panelGrid>
				<p:commandButton value="Search!!" update="regGrid"
				action="#{FlightBean.searchByDeparture()}" />
		</p:panel>
		
</h:form>

<h:dataTable value="#{FlightBean.ff2}" var="item">
    		<h:column>#{item}</h:column>
		</h:dataTable>
<h:form>
		<p:panel header="Find By departure">	
		<h:panelGrid columns="3" id="regGrid">	
				<br /> <br />
				<h:outputLabel for="id">Id:</h:outputLabel>
				<p:inputText id="id" value="#{FlightBean.id}" />
				<p:message for="id" />
				
				<p:commandButton value="Select the id you want to modify" update="regGrid" />
				</h:panelGrid>
		</p:panel>
</h:form>

<h:form>
<p:panel header="Remove Flight">	
		<h:panelGrid columns="3" id="regGrid5">	
<h:outputLabel for="id2">#Id:</h:outputLabel>
				<p:inputText id="id2" value="#{FlightBean.id}" />
				<p:message for="id2" />		
				<p:commandButton value="Remove the typed Packet" action="#{FlightBean.remove()}" update="regGrid5" />	
</h:panelGrid>
</p:panel>
</h:form>
<h:link outcome="/admin/index" value="Home" /> <br />
<h:link outcome="/admin/modifyFlight" value="to Modify" /> <br />



</h:body>
</html>